package com.central.common.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.central.common.enums.DbType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;


/**
 * @author Tindy
 * @date 2021/7/5
 * @describe
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("datasource_info")
@ToString
public class DatasourceInfo extends SuperEntity {
    private String name;
    private String description;
    private DbType datasourceType;
    private String host;
    private String port;
    private String dbName;
    private String username;
    private String password;
    private String other;
    private String driver;
    private String keytabUrl;
    private Long keytabQuoteId;
    private String krb5ConfUrl;
    private Long krb5ConfQuoteId;
    private Boolean isSys;

    public String findKeytabName(){
        String[] split = keytabUrl.split("/");
        return split[split.length-1];
    }
    public String findKrb5ConfName(){
        String[] split = krb5ConfUrl.split("/");
        return split[split.length-1];
    }
}
